package net.sppan.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.sppan.base.dao.IConfigureParameterDao;
import net.sppan.base.dao.support.IBaseDao;
import net.sppan.base.entity.ConfigureParameter;
import net.sppan.base.service.IConfigureParameterService;
import net.sppan.base.service.specification.SimpleSpecificationBuilder;
import net.sppan.base.service.specification.SpecificationOperator.Operator;
import net.sppan.base.service.support.impl.BaseServiceImpl;
@Service
public class ConfigureParameterServiceImpl extends BaseServiceImpl<ConfigureParameter, String>  implements
		IConfigureParameterService {

	@Autowired
	private IConfigureParameterDao  configureParameterDao;
	@Override
	public IBaseDao<ConfigureParameter, String> getBaseDao() {
		return this.configureParameterDao;
	}
	
	@Override
	public boolean getAuth(String dyId){
		SimpleSpecificationBuilder<ConfigureParameter> builder = new SimpleSpecificationBuilder<ConfigureParameter>();
		builder.add("groupId", Operator.eq.name(), "1002");
		builder.add("parameterValue",   Operator.likeAll.name(), dyId);
		List<ConfigureParameter>  configureParameters =configureParameterDao.findAll(builder.generateSpecification());
		if(!configureParameters.isEmpty()&&configureParameters.size()>0){
			 return true;
		}
		return false;
	}
	
}
